package model;

import java.sql.Timestamp;

/**
 * This is a builder class for Meeting.
 * 
 * The meeting builder class uses the builder design pattern to create an
 * meeting object with multiple parameters.
 * 
 * @author Sukhjinder K. Narula
 * @since June 2013
 * @version $Revision: 1.0 $
 */

public class MeetingBuilder {
	/**
	 * properties for the class meeting
	 */
	int id;
	int userId;
	String owner;
	int revisionId;
	String topic;
	String c_topic;
	String location;
	String c_location;
	Timestamp start;
	Timestamp c_start;
	Timestamp end;
	Timestamp c_end;
	String attendees;
	String c_attendees;
	String description;
	String c_description;

	/**
	 * Parameterless Constructor
	 */
	public MeetingBuilder() {
		id = -1;
		userId = 0;
		owner = "";
		revisionId = 0;
		topic = "";
		location = "";
		java.util.Date date = new java.util.Date();
		start = new Timestamp(date.getTime());
		end = new Timestamp(date.getTime());
		attendees = "";
		description = "";
	}

	/**
	 * Sets the meeting user id field
	 * 
	 * @param userId int
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setUserId(int userId) {
		this.userId = userId;
		return this;
	}


	/**
	 * Sets the meetings owner field
	 * 
	 * 
	 * @param owner String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setOwner(String owner) {
		this.owner = owner;
		return this;
	}

	/**
	 * Sets the meeting revision id field
	 * 
	 * @param revisionId int
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setRevisionId(int revisionId) {
		this.revisionId = revisionId;
		return this;
	}

	/**
	 * Sets the meetings topic field
	 * 
	 * 
	 * @param topic String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setTopic(String topic) {
		this.topic = topic;
		return this;
	}
	
	/**
	 * Sets the meetings copy of topic
	 * @param c_topic
	 * @return current meeting builder object
	 */
	public MeetingBuilder setCopyTopic(String c_topic)
	{
		this.c_topic=c_topic;
		return this;
	}

	/**
	 * Sets the meetings location field
	 * 
	 * 
	 * @param location
	 *            String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setLocation(String location) {
		this.location = location;
		return this;
	}

	/**
	 * Sets the meetings copy of location
	 * @param c_location
	 * @return the current meeting builder object
	 */
	public MeetingBuilder setCopyLocation(String c_location) {
		this.c_location = c_location;
		return this;
	}
	/**
	 * Sets the meeting start field
	 * 
	 * 
	 * @param start
	 *            Timestamp
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setStart(Timestamp start) {
		this.start = start;
		return this;
	}
	
	/**
	 * Sets the meetings copy of start time
	 * @param c_start
	 * @return current meeting builder object
	 */
	public MeetingBuilder setCopyStart(Timestamp c_start) {
		this.c_start = c_start;
		return this;
	}

	/**
	 * Sets the meeting end field
	 * 
	 * 
	 * @param end
	 *            Timestamp
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setEnd(Timestamp end) {
		this.end = end;
		return this;
	}
	
	/**
	 * Sets the meetings copy of end time
	 * @param c_end
	 * @return current meeting builder object
	 */
	public MeetingBuilder setCopyEnd(Timestamp c_end) {
		this.c_end = c_end;
		return this;
	}
	/**
	 * Sets the meetings attendees field
	 * 
	 * 
	 * @param attendees
	 *            String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setAttendees(String attendees) {
		this.attendees = attendees;
		return this;
	}
	
	/**
	 * Sets the meetings' copy of attendees
	 * @param c_attendees
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setCopyAttendees(String c_attendees) {
		this.c_attendees = c_attendees;
		return this;
	}
	/**
	 * Sets the meetings description field
	 * 
	 * 
	 * @param description
	 *            String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setDescription(String description) {
		this.description = description;
		return this;
	}
	
	/**
	 * Sets the meeting's copy of description
	 * @param c_description
	 * @return meeting builder object.
	 */
	public MeetingBuilder setCopyDescription(String c_description) {
		this.c_description = c_description;
		return this;
	}

	/**
	 * Build and return the meeting object
	 * 
	 * @return meeting object that has been built.
	 */
	public Meeting build() {
		return new Meeting(this.userId, this.owner, this.revisionId, 
				this.topic, this.location, this.start,
				this.end,  this.attendees, this.description);
	}

	/**
	 * Returns the meeting id
	 * 
	 * @return the meeting id
	 */
	public int getId() {
		return id;
	}

	/**
	 * Returns the user id
	 * 
	 * @return the user id
	 */
	public int getUserId() {
		return userId;
	}

	/**
	 * Returns the owner
	 * 
	 * @return the owner
	 */
	public String getOwner() {
		return owner;
	}

	/**
	 * Returns the revision id
	 * 
	 * @return the revision id
	 */
	public int getRevisionId() {
		return revisionId;
	}

	/**
	 * Returns the topic
	 * 
	 * @return the topic
	 */
	public String getTopic() {
		return topic;
	}

	/**
	 * Returns the location
	 * 
	 * @return the location
	 */
	public String getLocation() {
		return location;
	}

	/**
	 * Returns the start timestamp
	 * 
	 * @return the start timestamp
	 */
	public Timestamp getStart() {
		return start;
	}

	/**
	 * Returns the end timestamp
	 * 
	 * @return the end timestamp
	 */
	public Timestamp getEnd() {
		return end;
	}

	/**
	 * Returns the attendees
	 * 
	 * @return the attendees
	 */
	public String getAttendees() {
		return attendees;
	}

	/**
	 * Returns the description
	 * 
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

}
